FROM golang:1.15.2-alpine3.12
COPY src/deployment /go/src/deployment
RUN apk add git && \
    git clone https://gitee.com/yibuyiyin/net.git /go/src/golang.org/x/net && \
    cd /go && go install deployment

FROM node:12.18.3-alpine3.12
COPY src/ui /go/src/ui
RUN cd /go/src/ui && npm run-script build

FROM python:3.8.5-alpine3.12
MAINTAINER peng.yu@yibuyiyin.com
COPY --from=0 /go/bin/deployment /go/bin/deployment 
COPY --from=1 /go/src/ui/dist /go/bin/dist 
COPY src/script /go/bin/script
RUN pip3 install pexpect && apk add openssh

EXPOSE 1234
CMD ["/go/bin/deployment"]
